package org.openCage.artig;

import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
import org.openCage.io.fspath.FSPath;
import org.openCage.io.fspath.FSPathBuilder;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class GoCreate implements CmdArgs {

    @Argument()
    private List<String> arguments = new ArrayList<String>();

    @Option( name="-v", aliases = {"--verbose"}, usage = "turn on verbose messages")
    private boolean verbose;

    @Option( name="-p", aliases = {"--project"}, metaVar = "DIR", usage = "the project root, (defaults to current dir)")
    private String dir;

    @Option( name = "-t", aliases = {"--type"}, metaVar = "ArtigType", usage = "type of artig: project, module...", required = true)
    private String typ;

    @Option( name = "-g", aliases = {"--group"}, metaVar="groupId", usage = "groupid (think maven)", required = true )
    private String group;

    private FSPath projectDir;

    @Override
    public String getName() {
        return "create";
    }

    @Override
    public void go() {
        projectDir = FSPathBuilder.getPath( new File(dir).getAbsolutePath());

        //if ( projectDir.add(""))
        System.out.println("see create go");
    }

    @Override
    public String usage() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
}
